var relationshipController = require('../../controller/testcaseRelationshipController')
var expect = require('chai').expect


var dependencies =  [
    {
        "testCaseId" : "C",
        "dependency" : [
            {
                "testCaseId" : "B",
                "dependency" : [
                    {
                        "testCaseId" : "A",
                        "dependency" : [

                        ]
                    }
                ]
            }
        ]
    },
    {
        "testCaseId" : "F",
        "dependency" : [
            {
                "testCaseId" : "A",
                "dependency" : [

                ]
            }
        ]
    }
];
var orderedDependencies = [];
describe('test getOrderedDependencies',function () {
    it('test getOrderedDependencies',function () {
       expect(relationshipController.getOrderedDependencies(dependencies,orderedDependencies).length).to.be.equal(5);
       expect(JSON.stringify(orderedDependencies)).to.be.equal(JSON.stringify([{"testCaseId":"A"},{"testCaseId":"B"},{"testCaseId":"C"},{"testCaseId":"A"},{"testCaseId":"F"}]));
    })
})